<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
	<title>demo</title>
	<meta name="author" content="ice" />
	<meta name="viewport" content="width=device-width; initial-scale=1.0" />
	<link rel="stylesheet" href="css/common.css" />
	<link rel="stylesheet" href="css/welcome.css" />
</head>
<body>
	<div class="top"><strong>&lt;&lt;在线试卷系统</strong>&nbsp;&nbsp;&nbsp;DESIGN BY ICE</div>
	<form class="wel-log1" action="" method="post">
		<input type="text" id="name" class="wel-input1 bor" onfocus="clS(1);" onblur="clS(0);" value="用户名" />
		<input type="password" id="pwd" class="wel-input1 bor" onfocus="clS(3);" onblur="clS(2);" value="11111111" />
		<input type="password" id="repwd" class="wel-input1 bor" onfocus="clS(5);" onblur="clS(4);" value="11111111" />
		<input type="text" id="email" class="wel-input1 bor" onfocus="clS(7);" onblur="clS(6);" value="电子邮箱" />
		<input type="text" id="address" class="wel-input1 bor" onfocus="clS(9);" onblur="clS(8);" value="地址" />
		<div class="wel-input1 bor">
			<input type="radio" name="sex" /><span>男</span><input type="radio" name="sex" /><span>女</span>
		</div>
		<a class="wel-sub wel-sub2 bor">返回</a><input type="submit" class="wel-sub wel-sub1 bor" value="完成" />
	</form>
	
	<script type="text/javascript">
	function clS(t){
		if(t < 2){
			var srch = document.getElementById('name'), val = srch.value.toString().toLowerCase(), re = /^\s+$/;
			if(t) {
				if(val == '用户名'){ 
					srch.value = '';
					srch.style.color = "#333";
				}
			} else {
				if(val == '用户名' || val == '' || re.test(val)) {
					srch.style.color = "#999";
					srch.value = '用户名';
				}
			}
		}else if(t < 4){
			var srch = document.getElementById('pwd'), val = srch.value.toString().toLowerCase(), re = /^\s+$/;
			if(t == 3) {
				if(val == '11111111'){ 
					srch.value = '';
					srch.style.color = "#333";
				}
			} else {
				if(val == '11111111' || val == '' || re.test(val)) {
					srch.style.color = "#999";
					srch.value = '11111111';
				}
			}	
		}else if(t < 6){
			var srch = document.getElementById('repwd'), val = srch.value.toString().toLowerCase(), re = /^\s+$/;
			if(t == 5) {
				if(val == '11111111'){ 
					srch.value = '';
					srch.style.color = "#333";
				}
			} else {
				if(val == '11111111' || val == '' || re.test(val)) {
					srch.style.color = "#999";
					srch.value = '11111111';
				}
			}	
		}else if(t < 8){
			var srch = document.getElementById('email'), val = srch.value.toString().toLowerCase(), re = /^\s+$/;
			if(t == 7) {
				if(val == '电子邮箱'){ 
					srch.value = '';
					srch.style.color = "#333";
				}
			} else {
				if(val == '电子邮箱' || val == '' || re.test(val)) {
					srch.style.color = "#999";
					srch.value = '电子邮箱';
				}
			}
		}else{
			var srch = document.getElementById('address'), val = srch.value.toString().toLowerCase(), re = /^\s+$/;
			if(t == 9) {
				if(val == '地址'){ 
					srch.value = '';
					srch.style.color = "#333";
				}
			} else {
				if(val == '地址' || val == '' || re.test(val)) {
					srch.style.color = "#999";
					srch.value = '地址';
				}
			}
		}
	}
	</script>
</body>
</html>